package mse.eai.jbpm.dailyDigestProcess;

import java.util.Map;
import java.util.Map.Entry;

import org.jbpm.graph.def.ActionHandler;
import org.jbpm.graph.exe.ExecutionContext;

public class HandleSentDigest implements ActionHandler {

	@Override
	public void execute(ExecutionContext context) throws Exception {

		System.out.println("--------------- HANDLE DIGEST -------------------");
		
		
		Map<Integer,String> mapOfEmails = (Map<Integer,String>) context.getVariable("MapOfEmails");
		
		
		mapOfEmails.remove((Integer) context.getVariable("uid"));
		
		context.setVariable("MapOfEmails", mapOfEmails);
		System.out.println("-------------- MAPPED WAS UPDATED --------------------");

	
		
		
		System.out.println("-------------- REMAINING: "+ mapOfEmails.size() +"--------------------");
		
		context.leaveNode();
		
		
	}

}
